﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mangosoft.DiceCopy.Presentation.Domain.Contracts;
using Mangosoft.DiceCopy.Presentation.Domain.Models;
using Mangosoft.DiceCopy.Presentation.Domain.JobHuntingModuleService;

namespace Mangosoft.DiceCopy.Presentation.Domain.Agents {
    public class CoverLetterAgent : ICoverLetterAgent {
        public CoverLetterModel Get(Guid id) {
            var client = new JobHuntingModuleServiceClient();
            var data = client.FindCoverLetter(id);


            client.Close();

            var coverLetter = new CoverLetterModel {
                Body = data.Body,
                DateCreated = data.DateCreated,
                Id = data.Id,
                JobseekerId = data.JobseekerId,
                LastUpdated = data.LastUpdated,
                Subject = data.Subject
            };

            return coverLetter;          
        }
    }
}
